3.86 \(\int \frac{(a+b \tan (e+f x)) (A+B \tan (e+f x)+C \tan ^2(e+f x))}{(c+d \tan (e+f x))^3} \, dx\)

Optimal. Leaf size=352 \[ \frac{(b c-a d) \left (A d^2-B c d+c^2 C\right )}{2 d^2 f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}-\frac{a d^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )+b \left (-c^2 d^2 (A-3 C)+A d^4-2 B c d^3+c^4 C\right )}{d^2 f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))}+\frac{\left (A \left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right )-a \left (B c^3-3 B c d^2+3 c^2 C d-C d^3\right )+b \left (-3 B c^2 d+B d^3+c^3 C-3 c C d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}-\frac{x \left (a \left (-A \left (c^3-3 c d^2\right )-3 B c^2 d+B d^3+c^3 C-3 c C d^2\right )-b \left (d (A-C) \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right )}{\left (c^2+d^2\right )^3} \]

[Out]

-(((a*(c^3*C - 3*B*c^2*d - 3*c*C*d^2 + B*d^3 - A*(c^3 - 3*c*d^2)) - b*((A - C)*d*(3*c^2 - d^2) - B*(c^3 - 3*c*
d^2)))*x)/(c^2 + d^2)^3) + ((b*(c^3*C - 3*B*c^2*d - 3*c*C*d^2 + B*d^3) - a*(B*c^3 + 3*c^2*C*d - 3*B*c*d^2 - C*
d^3) + A*(a*d*(3*c^2 - d^2) - b*(c^3 - 3*c*d^2)))*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)^3*f) + ((
b*c - a*d)*(c^2*C - B*c*d + A*d^2))/(2*d^2*(c^2 + d^2)*f*(c + d*Tan[e + f*x])^2) - (b*(c^4*C - c^2*(A - 3*C)*d
^2 - 2*B*c*d^3 + A*d^4) + a*d^2*(2*c*(A - C)*d - B*(c^2 - d^2)))/(d^2*(c^2 + d^2)^2*f*(c + d*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.711263, antiderivative size = 349, normalized size of antiderivative = 0.99, number of steps used = 4, number of rules used = 4, integrand size = 43, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.093, Rules used = {3635, 3628, 3531, 3530} \[ \frac{(b c-a d) \left (A d^2-B c d+c^2 C\right )}{2 d^2 f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}-\frac{a d^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )+b \left (-c^2 d^2 (A-3 C)+A d^4-2 B c d^3+c^4 C\right )}{d^2 f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))}+\frac{\left (a A d \left (3 c^2-d^2\right )-a \left (B c^3-3 B c d^2+3 c^2 C d-C d^3\right )-A b \left (c^3-3 c d^2\right )+b \left (-3 B c^2 d+B d^3+c^3 C-3 c C d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}+\frac{x \left (-a \left (-A \left (c^3-3 c d^2\right )-3 B c^2 d+B d^3+c^3 C-3 c C d^2\right )+b d (A-C) \left (3 c^2-d^2\right )-b B \left (c^3-3 c d^2\right )\right )}{\left (c^2+d^2\right )^3} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(c + d*Tan[e + f*x])^3,x]

[Out]

((b*(A - C)*d*(3*c^2 - d^2) - b*B*(c^3 - 3*c*d^2) - a*(c^3*C - 3*B*c^2*d - 3*c*C*d^2 + B*d^3 - A*(c^3 - 3*c*d^
2)))*x)/(c^2 + d^2)^3 + ((a*A*d*(3*c^2 - d^2) - A*b*(c^3 - 3*c*d^2) + b*(c^3*C - 3*B*c^2*d - 3*c*C*d^2 + B*d^3
) - a*(B*c^3 + 3*c^2*C*d - 3*B*c*d^2 - C*d^3))*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)^3*f) + ((b*c
 - a*d)*(c^2*C - B*c*d + A*d^2))/(2*d^2*(c^2 + d^2)*f*(c + d*Tan[e + f*x])^2) - (b*(c^4*C - c^2*(A - 3*C)*d^2
- 2*B*c*d^3 + A*d^4) + a*d^2*(2*c*(A - C)*d - B*(c^2 - d^2)))/(d^2*(c^2 + d^2)^2*f*(c + d*Tan[e + f*x]))

Rule 3635

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Simp[((b*c - a*d)*(c^2*C - B*c*d + A*d^2)*
(c + d*Tan[e + f*x])^(n + 1))/(d^2*f*(n + 1)*(c^2 + d^2)), x] + Dist[1/(d*(c^2 + d^2)), Int[(c + d*Tan[e + f*x
])^(n + 1)*Simp[a*d*(A*c - c*C + B*d) + b*(c^2*C - B*c*d + A*d^2) + d*(A*b*c + a*B*c - b*c*C - a*A*d + b*B*d +
 a*C*d)*Tan[e + f*x] + b*C*(c^2 + d^2)*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] &&
NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && LtQ[n, -1]

Rule 3628

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f
_.)*(x_)]^2), x_Symbol] :> Simp[((A*b^2 - a*b*B + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2
)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[b*B + a*(A - C) - (A*b - a*B - b*C)*Tan[e +
 f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2
 + b^2, 0]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{(a+b \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx &=\frac{(b c-a d) \left (c^2 C-B c d+A d^2\right )}{2 d^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac{\int \frac{a d (A c-c C+B d)+b \left (c^2 C-B c d+A d^2\right )+d (A b c+a B c-b c C-a A d+b B d+a C d) \tan (e+f x)+b C \left (c^2+d^2\right ) \tan ^2(e+f x)}{(c+d \tan (e+f x))^2} \, dx}{d \left (c^2+d^2\right )}\\ &=\frac{(b c-a d) \left (c^2 C-B c d+A d^2\right )}{2 d^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac{b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )}{d^2 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac{\int \frac{-d \left (a \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )-d \left (2 a A c d-2 a c C d-A b \left (c^2-d^2\right )-a B \left (c^2-d^2\right )+b \left (c^2 C-2 B c d-C d^2\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )^2}\\ &=\frac{\left (b (A-C) d \left (3 c^2-d^2\right )-b B \left (c^3-3 c d^2\right )-a \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3-A \left (c^3-3 c d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^3}+\frac{(b c-a d) \left (c^2 C-B c d+A d^2\right )}{2 d^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac{b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )}{d^2 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac{\left (a A d \left (3 c^2-d^2\right )-A b \left (c^3-3 c d^2\right )+b \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3\right )-a \left (B c^3+3 c^2 C d-3 B c d^2-C d^3\right )\right ) \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^3}\\ &=\frac{\left (b (A-C) d \left (3 c^2-d^2\right )-b B \left (c^3-3 c d^2\right )-a \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3-A \left (c^3-3 c d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^3}+\frac{\left (a A d \left (3 c^2-d^2\right )-A b \left (c^3-3 c d^2\right )+b \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3\right )-a \left (B c^3+3 c^2 C d-3 B c d^2-C d^3\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^3 f}+\frac{(b c-a d) \left (c^2 C-B c d+A d^2\right )}{2 d^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac{b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )}{d^2 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}\\ \end{align*}

Mathematica [C]  time = 6.02578, size = 331, normalized size = 0.94 \[ \frac{2 d (a B+A b-b C) \left (\frac{d \left (2 c \log (c+d \tan (e+f x))-\frac{c^2+d^2}{c+d \tan (e+f x)}\right )}{\left (c^2+d^2\right )^2}-\frac{i \log (-\tan (e+f x)+i)}{2 (c+i d)^2}+\frac{i \log (\tan (e+f x)+i)}{2 (c-i d)^2}\right )-d (-a A d+a B c+a C d+A b c+b B d-b c C) \left (\frac{d \left (\left (6 c^2-2 d^2\right ) \log (c+d \tan (e+f x))-\frac{\left (c^2+d^2\right ) \left (5 c^2+4 c d \tan (e+f x)+d^2\right )}{(c+d \tan (e+f x))^2}\right )}{\left (c^2+d^2\right )^3}+\frac{\log (-\tan (e+f x)+i)}{(d-i c)^3}+\frac{\log (\tan (e+f x)+i)}{(d+i c)^3}\right )+\frac{a C d-b (B d+c C)}{(c+d \tan (e+f x))^2}-\frac{2 C d (a+b \tan (e+f x))}{(c+d \tan (e+f x))^2}}{2 d^2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(c + d*Tan[e + f*x])^3,x]

[Out]

((a*C*d - b*(c*C + B*d))/(c + d*Tan[e + f*x])^2 - (2*C*d*(a + b*Tan[e + f*x]))/(c + d*Tan[e + f*x])^2 + 2*(A*b
 + a*B - b*C)*d*(((-I/2)*Log[I - Tan[e + f*x]])/(c + I*d)^2 + ((I/2)*Log[I + Tan[e + f*x]])/(c - I*d)^2 + (d*(
2*c*Log[c + d*Tan[e + f*x]] - (c^2 + d^2)/(c + d*Tan[e + f*x])))/(c^2 + d^2)^2) - d*(A*b*c + a*B*c - b*c*C - a
*A*d + b*B*d + a*C*d)*(Log[I - Tan[e + f*x]]/((-I)*c + d)^3 + Log[I + Tan[e + f*x]]/(I*c + d)^3 + (d*((6*c^2 -
 2*d^2)*Log[c + d*Tan[e + f*x]] - ((c^2 + d^2)*(5*c^2 + d^2 + 4*c*d*Tan[e + f*x]))/(c + d*Tan[e + f*x])^2))/(c
^2 + d^2)^3))/(2*d^2*f)

________________________________________________________________________________________

Maple [B]  time = 0.07, size = 1513, normalized size = 4.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^3,x)

[Out]

3/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*C*b*c*d^2-2/f/(c^2+d^2)^2*d/(c+d*tan(f*x+e))*A*a*c+2/f/(c^2+d^2)^2*d/(c+d
*tan(f*x+e))*B*b*c+2/f/(c^2+d^2)^2*d/(c+d*tan(f*x+e))*C*a*c-1/f/(c^2+d^2)^2/d^2/(c+d*tan(f*x+e))*C*b*c^4-3/f/(
c^2+d^2)^3*A*arctan(tan(f*x+e))*a*c*d^2+3/f/(c^2+d^2)^3*A*arctan(tan(f*x+e))*b*c^2*d+3/f/(c^2+d^2)^3*B*arctan(
tan(f*x+e))*a*c^2*d+3/f/(c^2+d^2)^3*B*arctan(tan(f*x+e))*b*c*d^2+3/f/(c^2+d^2)^3*C*arctan(tan(f*x+e))*a*c*d^2-
3/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*C*b*c*d^2-1/2/f/d/(c^2+d^2)/(c+d*tan(f*x+e))^2*B*b*c^2-1/2/f/d/(c^2+d^2)/(c
+d*tan(f*x+e))^2*C*a*c^2-3/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*A*a*c^2*d+3/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*A*a
*c^2*d+3/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*A*b*c*d^2+3/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*B*a*c*d^2-3/f/(c^2+d^2)
^3*ln(c+d*tan(f*x+e))*B*b*c^2*d+1/2/f/d^2/(c^2+d^2)/(c+d*tan(f*x+e))^2*C*b*c^3-3/2/f/(c^2+d^2)^3*ln(1+tan(f*x+
e)^2)*A*b*c*d^2-3/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*B*a*c*d^2+3/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*B*b*c^2*d+
3/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*C*a*c^2*d-1/2/f*d/(c^2+d^2)/(c+d*tan(f*x+e))^2*A*a-1/f/(c^2+d^2)^3*B*arct
an(tan(f*x+e))*b*c^3-1/f/(c^2+d^2)^3*C*arctan(tan(f*x+e))*a*c^3+1/f/(c^2+d^2)^3*C*arctan(tan(f*x+e))*b*d^3+1/2
/f/(c^2+d^2)/(c+d*tan(f*x+e))^2*A*b*c+1/2/f/(c^2+d^2)/(c+d*tan(f*x+e))^2*B*a*c+1/2/f/(c^2+d^2)^3*ln(1+tan(f*x+
e)^2)*A*a*d^3+1/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*A*b*c^3+1/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*B*a*c^3-1/f/(c
^2+d^2)^3*ln(c+d*tan(f*x+e))*A*a*d^3-1/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*A*b*c^3-1/f/(c^2+d^2)^3*ln(c+d*tan(f*x
+e))*B*a*c^3+1/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*B*b*d^3+1/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*C*a*d^3+1/f/(c^2+d^
2)^2/(c+d*tan(f*x+e))*A*b*c^2+1/f/(c^2+d^2)^2/(c+d*tan(f*x+e))*B*a*c^2-3/f/(c^2+d^2)^2/(c+d*tan(f*x+e))*C*b*c^
2+1/f/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*C*b*c^3-1/f/(c^2+d^2)^2*d^2/(c+d*tan(f*x+e))*A*b-1/f/(c^2+d^2)^2*d^2/(c+d
*tan(f*x+e))*B*a-1/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*B*b*d^3-1/2/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*C*a*d^3-1/2
/f/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*C*b*c^3+1/f/(c^2+d^2)^3*A*arctan(tan(f*x+e))*a*c^3-1/f/(c^2+d^2)^3*A*arctan(
tan(f*x+e))*b*d^3-1/f/(c^2+d^2)^3*B*arctan(tan(f*x+e))*a*d^3-3/f/(c^2+d^2)^3*C*arctan(tan(f*x+e))*b*c^2*d-3/f/
(c^2+d^2)^3*ln(c+d*tan(f*x+e))*C*a*c^2*d

________________________________________________________________________________________

Maxima [A]  time = 1.53331, size = 733, normalized size = 2.08 \begin{align*} \frac{\frac{2 \,{\left ({\left ({\left (A - C\right )} a - B b\right )} c^{3} + 3 \,{\left (B a +{\left (A - C\right )} b\right )} c^{2} d - 3 \,{\left ({\left (A - C\right )} a - B b\right )} c d^{2} -{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{2 \,{\left ({\left (B a +{\left (A - C\right )} b\right )} c^{3} - 3 \,{\left ({\left (A - C\right )} a - B b\right )} c^{2} d - 3 \,{\left (B a +{\left (A - C\right )} b\right )} c d^{2} +{\left ({\left (A - C\right )} a - B b\right )} d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left ({\left (B a +{\left (A - C\right )} b\right )} c^{3} - 3 \,{\left ({\left (A - C\right )} a - B b\right )} c^{2} d - 3 \,{\left (B a +{\left (A - C\right )} b\right )} c d^{2} +{\left ({\left (A - C\right )} a - B b\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{C b c^{5} + A a d^{5} +{\left (C a + B b\right )} c^{4} d -{\left (3 \, B a +{\left (3 \, A - 5 \, C\right )} b\right )} c^{3} d^{2} +{\left ({\left (5 \, A - 3 \, C\right )} a - 3 \, B b\right )} c^{2} d^{3} +{\left (B a + A b\right )} c d^{4} + 2 \,{\left (C b c^{4} d -{\left (B a +{\left (A - 3 \, C\right )} b\right )} c^{2} d^{3} + 2 \,{\left ({\left (A - C\right )} a - B b\right )} c d^{4} +{\left (B a + A b\right )} d^{5}\right )} \tan \left (f x + e\right )}{c^{6} d^{2} + 2 \, c^{4} d^{4} + c^{2} d^{6} +{\left (c^{4} d^{4} + 2 \, c^{2} d^{6} + d^{8}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d^{3} + 2 \, c^{3} d^{5} + c d^{7}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/2*(2*(((A - C)*a - B*b)*c^3 + 3*(B*a + (A - C)*b)*c^2*d - 3*((A - C)*a - B*b)*c*d^2 - (B*a + (A - C)*b)*d^3)
*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 2*((B*a + (A - C)*b)*c^3 - 3*((A - C)*a - B*b)*c^2*d - 3*(B*a
 + (A - C)*b)*c*d^2 + ((A - C)*a - B*b)*d^3)*log(d*tan(f*x + e) + c)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + ((B
*a + (A - C)*b)*c^3 - 3*((A - C)*a - B*b)*c^2*d - 3*(B*a + (A - C)*b)*c*d^2 + ((A - C)*a - B*b)*d^3)*log(tan(f
*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - (C*b*c^5 + A*a*d^5 + (C*a + B*b)*c^4*d - (3*B*a + (3*A -
5*C)*b)*c^3*d^2 + ((5*A - 3*C)*a - 3*B*b)*c^2*d^3 + (B*a + A*b)*c*d^4 + 2*(C*b*c^4*d - (B*a + (A - 3*C)*b)*c^2
*d^3 + 2*((A - C)*a - B*b)*c*d^4 + (B*a + A*b)*d^5)*tan(f*x + e))/(c^6*d^2 + 2*c^4*d^4 + c^2*d^6 + (c^4*d^4 +
2*c^2*d^6 + d^8)*tan(f*x + e)^2 + 2*(c^5*d^3 + 2*c^3*d^5 + c*d^7)*tan(f*x + e)))/f

________________________________________________________________________________________

Fricas [B]  time = 1.63896, size = 1905, normalized size = 5.41 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/2*(C*b*c^5 - A*a*d^5 - 3*(C*a + B*b)*c^4*d + 5*(B*a + (A - C)*b)*c^3*d^2 - ((7*A - 3*C)*a - 3*B*b)*c^2*d^3 -
 (B*a + A*b)*c*d^4 + 2*(((A - C)*a - B*b)*c^5 + 3*(B*a + (A - C)*b)*c^4*d - 3*((A - C)*a - B*b)*c^3*d^2 - (B*a
 + (A - C)*b)*c^2*d^3)*f*x + (C*b*c^5 - A*a*d^5 + (C*a + B*b)*c^4*d - (3*B*a + (3*A - 7*C)*b)*c^3*d^2 + 5*((A
- C)*a - B*b)*c^2*d^3 + 3*(B*a + A*b)*c*d^4 + 2*(((A - C)*a - B*b)*c^3*d^2 + 3*(B*a + (A - C)*b)*c^2*d^3 - 3*(
(A - C)*a - B*b)*c*d^4 - (B*a + (A - C)*b)*d^5)*f*x)*tan(f*x + e)^2 - ((B*a + (A - C)*b)*c^5 - 3*((A - C)*a -
B*b)*c^4*d - 3*(B*a + (A - C)*b)*c^3*d^2 + ((A - C)*a - B*b)*c^2*d^3 + ((B*a + (A - C)*b)*c^3*d^2 - 3*((A - C)
*a - B*b)*c^2*d^3 - 3*(B*a + (A - C)*b)*c*d^4 + ((A - C)*a - B*b)*d^5)*tan(f*x + e)^2 + 2*((B*a + (A - C)*b)*c
^4*d - 3*((A - C)*a - B*b)*c^3*d^2 - 3*(B*a + (A - C)*b)*c^2*d^3 + ((A - C)*a - B*b)*c*d^4)*tan(f*x + e))*log(
(d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) + 2*((C*a + B*b)*c^5 - (2*B*a + (2*A - 3
*C)*b)*c^4*d + 3*((A - C)*a - B*b)*c^3*d^2 + 3*(B*a + (A - C)*b)*c^2*d^3 - ((3*A - 2*C)*a - 2*B*b)*c*d^4 - (B*
a + A*b)*d^5 + 2*(((A - C)*a - B*b)*c^4*d + 3*(B*a + (A - C)*b)*c^3*d^2 - 3*((A - C)*a - B*b)*c^2*d^3 - (B*a +
 (A - C)*b)*c*d^4)*f*x)*tan(f*x + e))/((c^6*d^2 + 3*c^4*d^4 + 3*c^2*d^6 + d^8)*f*tan(f*x + e)^2 + 2*(c^7*d + 3
*c^5*d^3 + 3*c^3*d^5 + c*d^7)*f*tan(f*x + e) + (c^8 + 3*c^6*d^2 + 3*c^4*d^4 + c^2*d^6)*f)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)**2)/(c+d*tan(f*x+e))**3,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.82195, size = 1400, normalized size = 3.98 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/2*(2*(A*a*c^3 - C*a*c^3 - B*b*c^3 + 3*B*a*c^2*d + 3*A*b*c^2*d - 3*C*b*c^2*d - 3*A*a*c*d^2 + 3*C*a*c*d^2 + 3*
B*b*c*d^2 - B*a*d^3 - A*b*d^3 + C*b*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (B*a*c^3 + A*b*c^3 -
C*b*c^3 - 3*A*a*c^2*d + 3*C*a*c^2*d + 3*B*b*c^2*d - 3*B*a*c*d^2 - 3*A*b*c*d^2 + 3*C*b*c*d^2 + A*a*d^3 - C*a*d^
3 - B*b*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 2*(B*a*c^3*d + A*b*c^3*d - C*b*c^3*
d - 3*A*a*c^2*d^2 + 3*C*a*c^2*d^2 + 3*B*b*c^2*d^2 - 3*B*a*c*d^3 - 3*A*b*c*d^3 + 3*C*b*c*d^3 + A*a*d^4 - C*a*d^
4 - B*b*d^4)*log(abs(d*tan(f*x + e) + c))/(c^6*d + 3*c^4*d^3 + 3*c^2*d^5 + d^7) + (3*B*a*c^3*d^4*tan(f*x + e)^
2 + 3*A*b*c^3*d^4*tan(f*x + e)^2 - 3*C*b*c^3*d^4*tan(f*x + e)^2 - 9*A*a*c^2*d^5*tan(f*x + e)^2 + 9*C*a*c^2*d^5
*tan(f*x + e)^2 + 9*B*b*c^2*d^5*tan(f*x + e)^2 - 9*B*a*c*d^6*tan(f*x + e)^2 - 9*A*b*c*d^6*tan(f*x + e)^2 + 9*C
*b*c*d^6*tan(f*x + e)^2 + 3*A*a*d^7*tan(f*x + e)^2 - 3*C*a*d^7*tan(f*x + e)^2 - 3*B*b*d^7*tan(f*x + e)^2 - 2*C
*b*c^6*d*tan(f*x + e) + 8*B*a*c^4*d^3*tan(f*x + e) + 8*A*b*c^4*d^3*tan(f*x + e) - 14*C*b*c^4*d^3*tan(f*x + e)
- 22*A*a*c^3*d^4*tan(f*x + e) + 22*C*a*c^3*d^4*tan(f*x + e) + 22*B*b*c^3*d^4*tan(f*x + e) - 18*B*a*c^2*d^5*tan
(f*x + e) - 18*A*b*c^2*d^5*tan(f*x + e) + 12*C*b*c^2*d^5*tan(f*x + e) + 2*A*a*c*d^6*tan(f*x + e) - 2*C*a*c*d^6
*tan(f*x + e) - 2*B*b*c*d^6*tan(f*x + e) - 2*B*a*d^7*tan(f*x + e) - 2*A*b*d^7*tan(f*x + e) - C*b*c^7 - C*a*c^6
*d - B*b*c^6*d + 6*B*a*c^5*d^2 + 6*A*b*c^5*d^2 - 9*C*b*c^5*d^2 - 14*A*a*c^4*d^3 + 11*C*a*c^4*d^3 + 11*B*b*c^4*
d^3 - 7*B*a*c^3*d^4 - 7*A*b*c^3*d^4 + 4*C*b*c^3*d^4 - 3*A*a*c^2*d^5 - B*a*c*d^6 - A*b*c*d^6 - A*a*d^7)/((c^6*d
^2 + 3*c^4*d^4 + 3*c^2*d^6 + d^8)*(d*tan(f*x + e) + c)^2))/f